package com.mode.mvp.joke;

import com.mode.mvp.bean.Joke;
import com.mode.mvp.listener.OnMVPListener;

public class JokeModel implements JokeContract.JokeModel {

    public static final String REQUEST_SERVER_URL = "http://api.jisuapi.com/xiaohua/text?";

    public static final String APPKEY = "&appkey=9814b57c706d0a23";

    //http://api.jisuapi.com/xiaohua/text?pagenum=10&pagesize=3&appkey=9814b57c706d0a23
    @Override
    public void requestJoke(String pNum, String pSize, final OnMVPListener pMVPListener) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(3000);
                    //网络请求，获取数据
                    pMVPListener.onSuccess(new Joke());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
